package com.gitee.huanminabc.ddd.converter;

import com.gitee.huanminabc.ddd.entity.WorkEntity;
import com.gitee.huanminabc.ddd.entity.WorkLogEntity;
import com.gitee.huanminabc.mapstruct.BaseConverter;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.Date;

/**
 * @Author huanmin
 * @Date 2024/6/6 上午9:46
 */
@Mapper(imports = {Date.class})
public interface WorkEntityToWorkLogEntityToConverter extends BaseConverter<WorkEntity, WorkLogEntity> {


    @Mapping(target = "fieldsLog", source = "fields")
    @Mapping(target = "updateBy", source = "operator")
    @Mapping(target = "updateTime", expression = "java(new Date())")
    @Override
    WorkLogEntity sourceToTarget(WorkEntity var1);
}
